<?php

namespace App\Repositories\Permission;

use  App\Repositories\Repository;
use App\Models\Permission;
use Illuminate\Support\Facades\Request;

class PermissionRepository extends Repository {

	public function __construct(Permission $permission) {
		$this->model = $permission;
	}

	/**
	 * 更新一条记录
	 * @param array  $data
	 * @param        $id
	 * @param string $attribute
	 * @return mixed
	 */
	public function update(array $data, $id, $attribute = "id") {
		return $this->model->where($attribute, $id)->update([
			'display_name' => $data['display_name'],
			'description'  => $data['description'],
		]);
	}
}
